package com.dongdong.bookstore.config;

import com.dongdong.bookstore.common.config.BaseSwaggerConfig;
import com.dongdong.bookstore.common.domain.SwaggerProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author chiangkai
 * @date 2021-10-18
 * @email chiangkk@163.com
 */
@Slf4j
@Configuration
@EnableSwagger2
public class SwaggerConfig extends BaseSwaggerConfig {

    /**
     * SpringBoot获取当前环境代码,Spring获取当前环境代码
     */
    @Value("${spring.profiles.active}")
    private String profiles;

    @Override
    public SwaggerProperties swaggerProperties() {
        
        return SwaggerProperties.builder()
                .apiBasePackage("com.dongdong.bookstore.module")
                .title("bookStore项目骨架")
                .description("BookStore项目骨架相关接口文档")
                .contactName("chiangkkai")
                .version("1.0")
                .enableSecurity(true)
                .build();
    }
}
